% TEST_ID: LANG-EXPAND-0034
% CATEGORY: language/array-ops/ops
% 测试 ^ 运算符

function test_mpow
    A = [1, 2; 3, 4];
    C = A ^ 2;
    assert_isclose(C, [7 10; 15 22]);

    A = [1, 2; 3, 4];
    C = A ^ -1;
    assert_isclose(C, [-2 1; 1.5 -0.5]);
end

function assert_isclose(x, y)
    assert(all(abs(x - y) < 1e-14))
end
